public class Rectangle {
	private Point p1, p2;
	
	Rectangle(Point p1, Point p2) {
		this.p1 = p1;
		this.p2 = p2;
	}
	
	
	//Declare variables for length, width and area
	public Double getArea() {
		double l = 0.0;
		double w = 0.0;
		double area = 0.0;
		
	//Calculate length
		l = p2.y - p1.y;
		
	//Calculate width
		w = p2.x - p1.x;
		
	//Calculate area
		area = Math.abs(l*w);
			
		return area;
	}
	
	//Declaring variables representing pythagorean theorem a^2 + b^2 = c^2
	public Double getDiagonal() {
		double aSquared = 0.0;
		double bSquared = 0.0;
		double cSquared = 0.0;
		double length = 0.0;
		
		aSquared = (p2.x - p1.x) * (p2.x - p1.x);
		bSquared = (p2.y - p1.y) * (p2.y - p1.y);
		cSquared = aSquared+bSquared;
		length = Math.sqrt(cSquared);
		
		return length;
	}
}
